/**
 * Created by Freeman on 2016/8/3.
 */
import {SHOW_MSG,HIDE_MSG} from '../constants/ActionTypes'
const initialState = {
    type: '',
    content: '',
    title: ''
};

export default function msg(state=initialState,action={}) {
    switch (action.type){
        case SHOW_MSG:
            return {
                ...state,
                ...action.message
            };
        case HIDE_MSG:
            return {
                ...state,
                ...initialState
            };
        default :
            return state;
    }
}